#include "ffmpegwrapper.h"

#include <QtGui>

FFMPEGWrapper::FFMPEGWrapper()
{
}

void FFMPEGWrapper::run()
{
    QString program = "/usr/bin/ffmpeg";
    QStringList arguments;
    arguments << "-r" << "1";
    arguments << "-b" << "1800";
    arguments << "-i" << m_workingDirectory + "/" + m_prefix + "%06d.jpg";
    arguments << m_workingDirectory + "/" + m_movieName;

    QProcess *ffmpegProcess = new QProcess(this);
    ffmpegProcess->start(program, arguments);

    qDebug() << program;
    qDebug() << arguments;
}

void FFMPEGWrapper::setWorkingDirectory(QString workingDirectory)
{
    m_workingDirectory = workingDirectory;
}

void FFMPEGWrapper::setPrefix(QString prefix)
{
    m_prefix = prefix;
}

void FFMPEGWrapper::setMovieName(QString movieName)
{
    m_movieName = movieName;
}
